module utils 
{
	/**
	 *
	 * @author 
	 *
	 */
	export class CoreData 
	{
        private static _instance: utils.CoreData;
        public stageScale: number;
		public stage: egret.Stage;
        public stageW:number;
        public stageH:number;
        //openid
        //在手机中需要全屏幕显示的宽高 
		// *** 因为显示到手机屏幕上需要乘以缩放值
		public screenW: number;
		public screenH: number;
    	
        //openid
		public userid: string;

        //当前关卡
		public cur_shut:number = 0;
       
		
        public StageY:number = 0;
        public StageX:number = 0;
        
        public failSound:egret.Sound;
		public successSound:egret.Sound;
        public rightSound:egret.Sound;

        public flag_word_arr:Array<string>;
        public user_info:any;

        public xx_time:number = 9000;
        public xx_min:number = 0.6;
        public xx_max:number = 1.1;
        public xx_alpha:number = 0.8;
        public constructor() 
		{
    		
		}
		
        public static getInstance():utils.CoreData
		{
            if(!utils.CoreData._instance)
            {
                this._instance = new utils.CoreData();
            }
            return this._instance;
		}

        public static get instance():utils.CoreData
		{
            if(!utils.CoreData._instance)
            {
                this._instance = new utils.CoreData();
            }
            return this._instance;
		}

        public playEffect(effectName:string):void
		{
			switch(effectName)
			{
				case "fail":
                if(!this.failSound){
                     this.failSound=RES.getRes("fail_mp3");
                }
				this.failSound.play(0,1);
				break
				case "success":
                if(!this.successSound){
                     this.successSound=RES.getRes("success_mp3");
                }
				this.successSound.play(0,1);
				break
                case "right":
                if(!this.rightSound){
                     this.rightSound=RES.getRes("right_mp3");
                }
				this.rightSound.play(0,1);
                break;
			}
		}



	}
}
